package com.zzptc.zzsgz.bdsjws.fragments;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.zzptc.zzsgz.bdsjws.R;
import com.zzptc.zzsgz.bdsjws.activities.OneKeySOSActivity;
import com.zzptc.zzsgz.bdsjws.fragments.base.BaseFragmentbase;

import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * Created by zzsgz on 2017/5/27.
 */

public class FirstFragment extends BaseFragmentbase {


    @Override
    public void initView() {

    }

    @Override
    public void initData() {

    }

    @Override
    public int getXML() {
        return R.layout.first_fragment;
    }




//开启一键求救
    @OnClick(R.id.btn_sos)
    public void onViewClicked() {
       // getFragmentManager().beginTransaction().hide().add(R.id.fl_sos,new SecondFragment()).commit();
        //首先要getActivity()获取宿主activity   宿主activity怎样管理Fragment
       if(getActivity() instanceof OneKeySOSActivity){
//调用Activity中的一个方法    到第二个Fragment
         ((OneKeySOSActivity) getActivity()).toSecondFragment();
       }
    }


}
